@extends('layouts.result')

@section('content')
<!-- 1.0 -->
<?php
	$imgurl = array(
		"https://cdn.adf.ly/images/banners/adfly.728x90.2.gif",
		"https://cdn.adf.ly/images/banners/adfly.728x90.1.gif"
		);
	$idx = rand(0,count($imgurl)-1);	
?>
<div class="row"><div style="width: 728px; text-align: center; font-family: verdana; font-size: 10px;"><a href="http://adf.ly/?id=7104086"><img border="0" src="<?php echo $imgurl[$idx]; ?>" width="728" height="90" title="AdF.ly - shorten links and earn money!" /></a><br /><a href="http://adf.ly/?id=7104086">Get paid to share your links!</a></div></div>
<table class="table table-striped table-hover">
<thead>
	<tr>
		<th class="col-lg-1">#</th>
		<th>Item Name</th>
		<th class="col-lg-2">Price</th>
		<th class="col-lg-1">Merchant</th>		
		<th class="col-lg-1">Vend Location</th>
	</tr>
</thead>

<tbody>

	@if (isset($search))
		<div class="container">Looking for {{{ $search }}}</div>
	@endif
	
	@foreach ($items as $key => $item)
		<tr id="item-{{ $key+1 }}">
			<td>{{ $key+1 }}</td>
			<td>{{ $item->item }}</td>
			<td>@if ($item->price == "nego")
				Negotiable
			@else
				{{ $item->price }}
			@endif</td>
			<td><button type="button" onClick="parent.location='http://adf.ly/7104086/merchantslist.cu.cc/details/{{$item->id}}/merch'" class="btn btn-primary"><span class="glyphicon glyphicon-hand-down"></span></button></td>
			<td><button type="button" onClick="parent.location='http://adf.ly/7104086/merchantslist.cu.cc/details/{{$item->id}}/loc'" class="btn btn-primary"><span class="glyphicon glyphicon-hand-down"></span></button></td>
		</tr><!-- {{ $key }} -->
	@endforeach
	
</tbody>
</table>

<ul class="pagination">
  {{ $items->appends(array('se'=>$search))->links() }}
</ul>
@stop